﻿<MTextField Value="Value"
            ValueChanged="@ValueChanged"
            BackgroundColor="@(BackgroundColor ?? "grey lighten-3")"
            Flat="@(!isFocused)"
            Class="rounded-lg"
            Dense
            HideDetails="true"
            Solo 
            Clearable="@Clearable"
            ClearIcon="@ClearIcon"
            Label="@Label">
    <PrependInnerContent>
        <MIcon Color="@(isFocused ? "grey" : "")" Size=16 Class="mr-2">
            @Icon
        </MIcon>
    </PrependInnerContent>
</MTextField>

@code {

    [Parameter]
    public bool Clearable { get; set; }

    [Parameter]
    public string? Label { get; set; }

    [Parameter]
    public string? Icon { get; set; }

    [Parameter]
    public string? Value { get; set; }

    [Parameter]
    public EventCallback<string> ValueChanged { get; set; }

    [Parameter]
    public string? BackgroundColor { get; set; }

    [Parameter]
    public string ClearIcon { get; set; } = "mdi-close-circle";

    private bool isFocused;

}
